//分页处理函数
var options = {
	currentPage: 1,
	totalPages: 5,
	numberOfPages: 3,
	bootstrapMajorVersion: 2,
	itemTexts: function(type, page, current) {
		switch (type) {
			case "first":
				return "首页";
			case "prev":
				return "上一页";
			case "next":
				return "下一页";
			case "last":
				return "尾页";
			case "page":
				return page;
		}
	},
	// Defines whether a page item should be shown.
	shouldShowPage: function(type, page, current) {
		var result = true;
		switch (type) {
			case "first":
				result= true;
				break;
			case "prev":
				result =true;
				break;
			case "next":
				result= true;
				break;
			case "last":
				result =true;
				break;
			case "page":
				result = true;
				break;
		}
		return result;
	},

	onPageClicked: function(e, originalEvent, type, page) {
		//这里做处理
		var cpage = page; //这个是当前页
		$(".gotopage").val(page);
	},
}
$('#example').bootstrapPaginator(options);

function changePage(numbers, totalnumbers) {
	var pagearr = $('#example').bootstrapPaginator('getPages');
	var totalpages = Math.ceil(totalnumbers / numbers);
	//console.log(totalpages);
	options = {
		currentPage: 1,
		totalPages: totalpages,
	}
	$('#example').bootstrapPaginator(options);
	$(".totapage-number").val(totalpages);
	$(".gotopage").val(1);
}